#ifndef FTSLIDEBUTTON_H
#define FTSLIDEBUTTON_H

#include <QtGui>
#include "ftcontrols.h"

class FTSlideButton : public QWidget
{
    Q_OBJECT
public:
    explicit FTSlideButton(Qt::Orientation,
                           FTControls::IconSize,
                           QWidget *parent = 0);

    void paintEvent(QPaintEvent *e);
    void mousePressEvent(QMouseEvent *);
    void mouseReleaseEvent(QMouseEvent *);
    void mouseMoveEvent(QMouseEvent *);

    void setOrientation(Qt::Orientation);
    void addState( int, const QIcon& );

    QSize sizeHint() const;
    QSize minimumSizeHint() const;

signals:
    void stateSet(int);

public slots:
    void setState(int);

private:
    QHash<int, QIcon> states;
    int selectedState;

    Qt::Orientation _orientation;
    QSize iconSize;

    QPoint mouse_start;
    QPoint mouse_delta;
    bool moving;
};

#endif // FTSLIDEBUTTON_H
